package servlets;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Servicio.*;

/**
 * Servlet implementation class Mantenimiento_Expediente
 */
@WebServlet("/Mantenimiento_Expediente")
public class Mantenimiento_Expediente extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	
	MantenExpedienteService servicio = new MantenExpedienteService();
	
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Mantenimiento_Expediente() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		
		System.out.println("entro");
		int a =0;
		List<Object> s;
		String d;
		String cotis = req.getParameter("listaCotizacion");
		System.out.println(cotis);
		
		List<List<Object>> lista = servicio.listaCotizacion(cotis);
		
		a = lista.size();
		
		System.out.println(a+"");
		
		/*
		s= lista.get(0);
		d= s.get(4).toString();
		System.out.println(d);
		
		*/
		req.setAttribute("listaCotizaciones", lista);
		//req.getRequestDispatcher("/frm4_Aprobar_Cotizacion_Bienes.jsp").forward(req, res);
		req.getRequestDispatcher("/listado.jsp").forward(req, res);
		
		
		
		
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
